<template>
  <div :class="$style.container">
    <div :class="$style.left" @click.stop="handleChangeClick">    
      <i v-if="obj.selected" :class="['iconfont', 'icon-iconset0126',$style.icon,$style.selected]"/>
      <i  v-else :class="['iconfont', 'icon-circle',$style.icon]"/>
    </div>
    <div :class="$style.right">
      <img v-lazy="obj.poster" />
      <div :class="$style.content">
        <h4>{{obj.original_title}}</h4>
        <p>
          <span>￥ {{obj.price.toFixed(2)}}</span>
        </p>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  props: {
    obj: {
      type: Object,
      default: () => {}
    }
  },
  methods: {
    handleChangeClick () {
      this.obj.selected = !this.obj.selected
    }
  }
}
</script>

<style lang='less' module>
.container {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  margin:10px 0px;
  .left {
    margin-left: 10px;
    margin-right: 10px;
    .icon {
      font-size:20px;
      color:#B7BBBF;
    }
    .selected {
      color:#20CC85;
      font-weight: bold;
    }
  }
  .right {
    width:345px;
    img {
      width: 70px;
      height:70px;
      vertical-align: top;
    }
    .content {
      display: inline-block;
      margin-left:12px;
      h4 {
        margin-top:10px;
        font-size: 15px;
        color: #2B333B;
        line-height: 20px;
        font-weight: bold;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
        word-break: break-all;
        word-wrap: break-word;
      }
      p {
        margin-top: 8px;
        font-size: 12px;
        line-height: 14px;
        span {
          color: #F01414;
        }
      }
    }
  }
}

</style>